<?php
@session_start();
include('includes/config.php');
include('includes/main_functions.php');

$ADMIN = @$_SESSION['ADMIN'];

$m = @$_GET['m'];
$a = @$_GET['a'];
?>
<html>
    <head>
        <title>Administartion panel</title>
        <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
        <link rel="stylesheet" type="text/css" href="includes/style.css" />

        <script type="text/javascript" src="http://www.plaxo.com/css/m/js/util.js"></script>
        <script type="text/javascript" src="http://www.plaxo.com/css/m/js/basic.js"></script>
        <script type="text/javascript" src="includes/abc_launcher.js"></script>
        <script type="text/javascript"><!--
            function onABCommComplete() {
                // OPTIONAL: do something here after the new data has been populated in your text area
            }
            //-->
        </script>
        <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
	<script  type="text/javascript"src="ckeditor/init.js"></script>
	<link rel="stylesheet" type="text/css" href="ckeditor/basic.css"/>
    </head>
    <body>
        <?php if(!empty($ADMIN)) { ?>
        <table width="100%" cellspacing="0" cellpadding="2">
            <tr>
                <td colspan="2" valign="top">
                        <?php include("./includes/header.php"); ?>
                </td>
            </tr>
        </table>
        <table width="100%" cellspacing="2" cellpadding="0" border="0">
            <tr>
                <td width="180" valign="top" bgcolor="#ededed">
                        <?php
                        include("./includes/leftbar.php");
                        include("./includes/leftbar.tpl");
                        ?>
                </td>
                <td valign="top">
                        <?php
                        if(empty($m)) $m = "start";
                        if(empty($a)) $a = "index";
                        if(file_exists("modules/$m/$a.php")) {
                            include("./modules/$m/$a.php");
                        } else {
                            $box_title = "Error: 404";
                            $box_contents = "Page doesn't exists, or it has been moved from this location.";
                        }
                        include("./includes/main.tpl");
                        ?>
                </td>
            </tr>
        </table>
        <table width="100%" cellspacing="0" cellpadding="2">
            <tr>
                <td colspan="2" valign="top">
                        <?php include("./includes/footer.php"); ?>
                </td>
            </tr>
        </table>
        <?php
        } else {
            include("./includes/login.php");
        }
        ?>
    </body>
</html>